<include file="Public:header" />
<form name="myform" id="myform" method="POST" action="" >
  <input name="data[id]" id="member_id" type="hidden" value="{$info.id}" />
  <fieldset>
    <legend>客户信息</legend>
    <table class="table_form" width="100%" cellspacing="0">
      <tbody>

        <tr>
          <th width="100">姓名：</th>
          <td><input name="data[name]" id="name" class="input-text" type="text" size="20" value="{$info.name}" />
            </td>
        </tr>
        <tr>
          <th>电话：</th>
          <td><input type="text" class="input-text hideborder" name="data[phone]" id="phone" size="20"  value="{$info.phone}" />
            </td>
        </tr>
        <tr>
          <th>地址：</th>
          <td><input type="text" class="input-text hideborder" name="data[address]" id="phone" size="20"  value="{$info.address}" style="width:240px;" />
            </td>
        </tr>
        <tr>
          <th>公司名称：</th>
          <td><input type="text" class="input-text hideborder" name="data[company]" id="phone" size="20"  value="{$info.company}" style="width:240px;" />
            </td>
        </tr>

        <tr >
          <th>备注：</th>
          <td><textarea name="data[remark]" id="remark" class="input-text" cols="60" rows="4" >
            {$info.remark}
            </textarea></td>
        </tr>
        <tr>
          <th>预约：</th>
          <td>
            <input name="data[order]" type="checkbox" value="1">
          </td>
        </tr>
        <tr class="last">
          <th>状态：</th>
          <td style="text-align:left">
            <label><input type="radio" name="status" value="1" />成交</label>
          	<label><input type="radio" name="status" value="0" <neq name="info.status" value="1"> checked </neq> />未成交</label>
		    </td>
        </tr>
      </tbody>
    </table>
  </fieldset>

  <input type="submit" value="提交" class="dialog" id="dosubmit">
</form>
</body>
</html>
<script type="text/javascript">
$(document).ready(function(e) {

    $('#myform').ajaxForm({
			beforeSubmit:  checkForm,
			success:       complete,
			dataType: 'json'
	});

	function checkForm(){
		var member_id = $("#member_id").val();
		var role_id = $("#role_id").val();
		var username  = $("#username").val();
		var password  = $("#password").val();
		if( member_id=='' && username.length<2 ){
			checkInfo('username','用户名不能为空！');
			$('#username').focus();
			return false;
		}
		if( member_id=='' && password.length<6 ){
			checkInfo('password','密码不能小于6个字符！');
			$('#password').focus();
			return false;
		}

		if(role_id==0){
			art.dialog({id:'TNCICC',content: '请选择分组！',time: 2,icon:'warning'});
			return false;
		}
		return true;
	}
	var origin = $.artDialog.open.origin;
	function complete(data){
		if(data.status==1){
			art.dialog({id:'TNCICC',content: data.info,time: 1,icon:'succeed'});
			setTimeout(function(){origin.location.reload();closeWin()},1500);
		}else{
			art.dialog({id:'TNCICC',content: data.info,time: 1,icon:'warning'});
		}

	}

});

</script>